<html>
<head><meta charset="utf-8"><title>patterns PR #82536 · t-compiler/wg-rfc-2229 · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/index.html">t-compiler/wg-rfc-2229</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/patterns.20PR.20.2382536.html">patterns PR #82536</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="228672005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/patterns%20PR%20%2382536/near/228672005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/patterns.20PR.20.2382536.html#228672005">(Mar 03 2021 at 21:30)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="307184">@rocksand</span> -- if you have a build of <a href="https://github.com/rust-lang/rust/issues/82536">#82536</a> can you try this test?</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="n">c</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="nb">drop</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">x</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="k">match</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">_</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">()</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="p">};</span><span class="w"></span>
</code></pre></div>



<a name="228675425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/patterns%20PR%20%2382536/near/228675425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/patterns.20PR.20.2382536.html#228675425">(Mar 03 2021 at 21:54)</a>:</h4>
<p><span class="user-mention" data-user-id="307184">@rocksand</span> do you know if the downcasst issue is only on enums or are structs affected as well?</p>



<a name="228675972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/patterns%20PR%20%2382536/near/228675972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rocksand <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/patterns.20PR.20.2382536.html#228675972">(Mar 03 2021 at 21:58)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> I don't know. I can try to figure that out tomorrow once I wrap up my assignment.</p>



<a name="228676155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/patterns%20PR%20%2382536/near/228676155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/patterns.20PR.20.2382536.html#228676155">(Mar 03 2021 at 21:59)</a>:</h4>
<p>We tested dumping MIR, and it seems like only enums get the downcast</p>



<a name="228692151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/patterns%20PR%20%2382536/near/228692151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/patterns.20PR.20.2382536.html#228692151">(Mar 04 2021 at 00:08)</a>:</h4>
<p>Did this cause any issues, or was it just surprising because of the inaccurate docs?</p>



<a name="228876524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/patterns%20PR%20%2382536/near/228876524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rocksand <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/patterns.20PR.20.2382536.html#228876524">(Mar 05 2021 at 00:34)</a>:</h4>
<p>I just tried the test case and it succeeded</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>